#pragma execution_character_set("utf-8") 

#include <QtWidgets/QApplication>
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#include <QOpenGLWindow>
#include "../window/GameWindow.h"

int main(int argc, char* argv[])
{
	QApplication a(argc, argv);
	QSurfaceFormat fmt;
	fmt.setDepthBufferSize(24);

	// Request OpenGL 3.3 core or OpenGL ES 3.0.
	if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
		qDebug("Requesting 3.3 core context");
		fmt.setVersion(3, 3);
		fmt.setProfile(QSurfaceFormat::CoreProfile);
	}
	else {
		qDebug("Requesting 3.0 context");
		fmt.setVersion(3, 0);
	}

	QSurfaceFormat::setDefaultFormat(fmt);
	GameWindow* window = new GameWindow();
	window->setWidth(800);
	window->setHeight(600);
	window->show();


	return a.exec();
}
